URL = {
	index: 	'/PersonalManage/index.html',
	auth:	'/PersonalManage/login',
	
	redirect:function( url ){
		self.location = url;
	},
	
	randomUrl:function( url ){
		time = new Date();
		if( url.indexOf("?") == -1 ){
			return url + "?time=" + time.getTime();
		}
		return url + "&time=" + time.getTime();
	}
}



AUTH = {
		
	zhigong: 'yuangong',
	kezhang: 'kezhang',
	juzhang: 'juzhang',
	
	isLogin:function(callback){
		$.post( URL.auth,
				{method:'islogin'	
				},
				 function(data)	{  
				//	alert(data[1]);
	   	    		if(data[0]=='error'){
	   	    			alert('Please Login!');
	   	    			self.location="index.html";
	   	    		}else{
	   	    			callback([data[1],data[2]]);
	   	    		}
	   				
	       	 });
	}
}

 function logout(){
	$.getJSON(URL.auth,{method:'logout'},function(data){
		//alert(data);
		self.location="index.html";
	});
}